﻿<UserControl x:Class="ConsoleHoster.View.Controls.ColorPallettePresenter"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Loaded="UserControl_Loaded_1">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Image x:Name="imgPallette" Source="/ConsoleHoster;component/Resources/ColorPallette.png" MouseMove="imgPallette_MouseMove"  MouseUp="imgPallette_MouseUp" Stretch="Fill" />

            <Rectangle x:Name="rctRelative" Grid.Column="1" Width="15" VerticalAlignment="Stretch" Fill="{Binding Path=RelativeFill, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="5, 5, 0, 5" />

            <Slider Orientation="Vertical" Grid.Column="2" Minimum="0" Maximum="100" ValueChanged="Slider_ValueChanged_1" />
            <!--Grid  Grid.Row="1" Visibility="Collapsed">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <TextBlock Text="Alpha: " />
                <Slider x:Name="sldAlpha" Grid.Column="1" Minimum="0" Maximum="255" Value="{Binding Path=Alpha, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" SmallChange="1" LargeChange="25" Cursor="Hand" />
                </Grid-->
        </Grid>

        <Grid Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="30" Margin="5, 5, 5, 5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Rectangle>
                <Rectangle.Fill>
                    <SolidColorBrush Color="{Binding SelectedColor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
                </Rectangle.Fill>
            </Rectangle>

            <Rectangle Grid.Column="1" Margin="5, 0, 0, 0">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{Binding PointingColor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
                </Rectangle.Fill>
            </Rectangle>
        </Grid>
    </Grid>
</UserControl>
